package com.design03_behavioral.pattern16_responsibilityChains.example01;

/**
 * @ClassName Client
 * @Description TODO
 * @Author zhangjunhao
 * @DATE 2023/9/8 1:08
 */
public class Client {
    public static void main(String[] args) {
        Handler h1 = new HandlerA();
        Handler h2 = new HandlerB();
        Handler h3 = new HandlerC();
        h1.setSuccessor(h2);
        h2.setSuccessor(h3);
        RequestData requestData = new RequestData("请求数据 ABCDE");
        h1.handle(requestData);
        //HandlerA 执行代码逻辑! 处理: 请求数据 ABCDE
        //HandlerB 执行代码逻辑! 处理: 请求数据 BCDE
        //HandlerC 执行代码逻辑! 处理: 请求数据 CDE
        //执行中止!
    }
}
